﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <link href="js/v5.1.3-dist/ol.css" rel="stylesheet" type="text/css" />
    <script src="js/v5.1.3-dist/ol.js" type="text/javascript"></script>
    <link href="css/example.css" rel="stylesheet" />
    <script src="js/InitMap.js"></script>
    <script type="text/javascript">
        window.onload = function () {
            var map = initMap();

            var layer = new ol.layer.Vector({
                source: new ol.source.Vector()
            });
            map.addLayer(layer);

            var multipolygon = new ol.geom.MultiPolygon([[[[118, 28], [117, 27], [117, 26]]], [[[116, 28], [115, 27], [115, 26]]]]);

            var polygon = new ol.geom.Polygon([[[115, 28], [114, 27], [114, 26]]]);
            multipolygon.appendPolygon(polygon);

            layer.getSource().addFeature(new ol.Feature({
                geometry: multipolygon
            }));
            map.getView().fit(multipolygon.getExtent());
        }


    </script>
</head>
<body>
    <div id="map">
    </div>
</body>
</html>
